package com.alasbusy.alasbusyapp.activity.detail;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.alasbusy.alasbusyapp.R;
import com.alasbusy.alasbusyapp.base.BaseActivity;
import com.zhy.android.percent.support.PercentLinearLayout;

public class BookDetailActivity extends BaseActivity implements View.OnClickListener {

    private ImageView book_detail_img;
    private TextView book_detail_title;
    private TextView book_detail_anthor;
    private TextView book_detail_status;
    private TextView book_detail_price;
    private TextView book_detail_jianjie;
    private TextView book_detail_fenlei;
    private TextView book_detail_zjliebiao;
    private TextView book_detail_time;
    private PercentLinearLayout book_detail_normal_layout;
    private TextView book_detail_all;
    private RecyclerView book_detail_recycle;
    private PercentLinearLayout book_detail_nopingjia_layout;
    private TextView book_detail_down;
    private TextView book_detail_startread;
    private TextView book_detail_add;

    @Override
    protected void initView() {
        PercentLinearLayout html_title = findViewById(R.id.book_detail_toptitle);
        setTop(html_title);
        getVisibility(true, this);
        getTitle("小说简介");

        book_detail_img = findViewById(R.id.book_detail_img);
        book_detail_title = findViewById(R.id.book_detail_title);
        book_detail_anthor = findViewById(R.id.book_detail_anthor);
        book_detail_status = findViewById(R.id.book_detail_status);
        book_detail_price = findViewById(R.id.book_detail_price);
        book_detail_jianjie = findViewById(R.id.book_detail_jianjie);
        book_detail_fenlei = findViewById(R.id.book_detail_fenlei);
        book_detail_zjliebiao = findViewById(R.id.book_detail_zjliebiao);
        book_detail_time = findViewById(R.id.book_detail_time);

        book_detail_normal_layout = findViewById(R.id.book_detail_normal_layout);
        book_detail_all = findViewById(R.id.book_detail_all);
        book_detail_recycle = findViewById(R.id.book_detail_recycle);

        book_detail_nopingjia_layout = findViewById(R.id.book_detail_nopingjia_layout);

        book_detail_down = findViewById(R.id.book_detail_down);
        book_detail_startread = findViewById(R.id.book_detail_startread);
        book_detail_add = findViewById(R.id.book_detail_add);
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initListener() {
        findViewById(R.id.book_detail_mulu).setOnClickListener(this);
        book_detail_down.setOnClickListener(this);
        book_detail_startread.setOnClickListener(this);
        book_detail_add.setOnClickListener(this);
    }

    @Override
    public int getLayout() {
        return R.layout.activity_book_detail;
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.book_detail_mulu:
                break;
            case R.id.book_detail_add:
                book_detail_add.setBackgroundColor(getResources().getColor(R.color.a54d1c7));
                book_detail_startread.setBackgroundColor(getResources().getColor(R.color.white));
                book_detail_down.setBackgroundColor(getResources().getColor(R.color.white));

                book_detail_add.setTextColor(getResources().getColor(R.color.white));
                book_detail_startread.setTextColor(getResources().getColor(R.color.a54d1c7));
                book_detail_down.setTextColor(getResources().getColor(R.color.a54d1c7));
                break;
            case R.id.book_detail_down:
                book_detail_down.setBackgroundColor(getResources().getColor(R.color.a54d1c7));
                book_detail_startread.setBackgroundColor(getResources().getColor(R.color.white));
                book_detail_add.setBackgroundColor(getResources().getColor(R.color.white));

                book_detail_add.setTextColor(getResources().getColor(R.color.a54d1c7));
                book_detail_startread.setTextColor(getResources().getColor(R.color.a54d1c7));
                book_detail_down.setTextColor(getResources().getColor(R.color.white));
                break;
            case R.id.book_detail_startread:
                book_detail_startread.setBackgroundColor(getResources().getColor(R.color.a54d1c7));
                book_detail_down.setBackgroundColor(getResources().getColor(R.color.white));
                book_detail_add.setBackgroundColor(getResources().getColor(R.color.white));

                book_detail_add.setTextColor(getResources().getColor(R.color.a54d1c7));
                book_detail_startread.setTextColor(getResources().getColor(R.color.white));
                book_detail_down.setTextColor(getResources().getColor(R.color.a54d1c7));
                break;
        }
    }
}
